projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
459bd56
)
Highlight typed variables in Python
author
Konstantin Kharlamov
<Hi-Angel@yandex.ru>
Wed, 3 Jun 2020 11:51:03 +0000
(14:51 +0300)
committer
Eli Zaretskii
<eliz@gnu.org>
Sat, 13 Jun 2020 07:31:13 +0000
(10:31 +0300)
* progmodes/python.el
(python-font-lock-keywords-maximum-decoration): Recognize
typed variables like "foo: int = 1" as well. (Bug#41684)
lisp/progmodes/python.el
patch
|
blob
|
history
diff --git
a/lisp/progmodes/python.el
b/lisp/progmodes/python.el
index 1ca9f019638c5e0d3ea2072a3f4d914b074add4a..aec27a58dea50412a5e9c214116610e5d6eda5ce 100644
(file)
--- a/
lisp/progmodes/python.el
+++ b/
lisp/progmodes/python.el
@@
-633,6
+633,8
@@
builtins.")
(,(lambda (limit)
(let ((re (python-rx (group (+ (any word ?. ?_)))
(? ?\[ (+ (not (any ?\]))) ?\]) (* space)
+ ;; A type, like " : int ".
+ (? ?: (* space) (+ (any word ?. ?_)) (* space))
assignment-operator))
(res nil))
(while (and (setq res (re-search-forward re limit t))